package com.black.cat.jvm.rtda;

import com.black.cat.jvm.rtda.heap.methodarea.JClass;
import com.black.cat.jvm.rtda.heap.methodarea.Slots;


public class JObject {
    JClass clazz;
    Slots fields;

    public JObject(JClass clazz){
        this.clazz = clazz;
        this.fields = new Slots(clazz.instanceSlotCount);
    }

    public JClass clazz(){
        return this.clazz;
    }

    public Slots fields(){
        return this.fields;
    }

    public boolean isInstanceOf(JClass clazz){
        return clazz.isAssignableFrom(this.clazz);
    }
}
